{template 'common/header'}
<div id="js-user-edit-base" ng-controller="UserEditOperatoers" ng-cloak>

	{template 'user/edit-header'}

	<table class="table we7-table">
		<tr>
			<th>操作应用</th>
			<th>所属平台</th>
			<th>权限信息</th>
			<th>操作</th>
		</tr>
		{loop $module_permission $permission}
		<tr>
			<td>{$modules_info[$permission['type']]['title']}</td>
			<td>{$accounts_info[$permission['uniacid']]['name']}</td>
			<td class="color-default">{$permission['count']} 项</td>
			{if $_W['isfounder']}
			<td class="color-default">
				<a target="_blank" href="{php echo url('module/display/switch', array('module_name' => $permission['permission_module'], 'uniacid' => $permission['uniacid'], 'redirect' => urlencode(url('module/permission/post', array('uid' => $permission['uid'], 'm' => $permission['permission_module'], 'uniacid' => $permission['uniacid']))) ))}">
					权限设置
				</a>
				{if empty($permission['main_module'])}
				<a ng-click="deleteClerk('{php echo url('module/permission/delete',  array('uid' => $permission['uid'], 'm' => $permission['permission_module'], 'uniacid' => $permission['uniacid']))}')" href="javascript:;">
					删除
				</a>
				{/if}
			</td>
			{/if}
		</tr>
		{/loop}
		{if empty($module_permission)}
		<tr>
			<td colspan="10" class="text-center">暂无应用...</td>
		</tr>
		{/if}
	</table>
	<div class="text-right">
		{$pager}
	</div>
</div>
<script>
	angular.module('userProfile').value('config', {
		user: {php echo !empty($user) ? json_encode($user) : 'null'},
        profile: {php echo !empty($profile) ? json_encode($profile) : 'null'},
		links: {
			recycleUser: "{php echo url('user/display/operate', array('type' => 'recycle'))}",
		},
    });
	angular.bootstrap($('#js-user-edit-base'), ['userProfile']);
</script>
{template 'common/footer'}

